import i18n from '@src/locales';
import translate from '@src/component/form/mixin/translate.js'
import FormTextSetting from './FormTextSetting.vue';
import FormTextPreview from './FormTextPreview.vue';
import FormText from './FormText.vue';
import { previewProps } from '@src/component/form/components/props';

import CustomerSerialNumberExtendSetting from './extend/CustomerSerialNumberExtendSetting.vue';
import CustomerNameExtendSetting from './extend/CustomerNameExtendSetting.vue';
import CustomerLmExtendSetting from './extend/CustomerLmExtendSetting.vue';

import ProductSerialNumberExtendSetting from './extend/ProductSerialNumberExtendSetting.vue';
import CustomerPhoneExtendSetting from './extend/CustomerPhoneExtendSetting.vue';
import ProductNameExtendSetting from './extend/ProductNameExtendSetting.vue';
import CustomerNameExtendSearch from './extend/CustomerNameExtendSearch.vue';
import LinkmanExtendSearch from './extend/LinkmanExtendSearch.vue';
import TextSearch from './../FormTextarea/extend/TextareaSearch.vue';
import PeriodExtendSearch from './extend/PeriodExtendSearch.vue';// 计划任务-高级搜索-重复周期

let FormTextField = {
  formType: 'text', // 字段类型
  name: i18n.t('common.form.type.text'),
  isSystem: 0,
  component: {
    setting: FormTextSetting,
    preview: FormTextPreview,
    build: FormText,
    extend: {
      'customer_serialNumber_setting': CustomerSerialNumberExtendSetting,
      'customer_name_setting': CustomerNameExtendSetting,
      'customer_lmName_setting': CustomerLmExtendSetting,
      'product_serialNumber_setting': ProductSerialNumberExtendSetting,
      'product_register_qrcodeId_setting': ProductNameExtendSetting,
      'product_name_setting': ProductNameExtendSetting,
      'customer_lmPhone_setting': CustomerPhoneExtendSetting,
      'customer_search': CustomerNameExtendSearch,
      'linkman_search': LinkmanExtendSearch,
      'text_search': TextSearch,
      'period-extend-search': PeriodExtendSearch
    }
  }
};

let TaskNoField = {
  formType: 'taskNo', // 字段类型
  name: i18n.t('common.form.type.taskNo'),
  isSystem: 1,
  component: {
    preview: {
      name: 'form-taskNo-preview',
      props: previewProps,
      mixins: [translate],
      render(){
        return (
          <div class="form-preview-group">
            <label>{this._displayName || this.$t('common.form.preview.taskNo.label')}</label>
          </div>
        )
      }
    }
  }
};
let EventNoField = {
  formType: 'eventNo', // 字段类型
  name: i18n.t('common.form.type.eventNo'),
  isSystem: 1,
  component: {
    preview: {
      name: 'form-eventNo-preview',
      props: previewProps,
      mixins: [translate],
      render(){
        return (
          <div class="form-preview-group">
            <label>{this._displayName || this.$t('common.form.preview.eventNo.label')}</label>
          </div>
        )
      }
    }
  }
};
export default [
  FormTextField,
  // TaskNoField,
  EventNoField
];


